import { Upload } from "@/api/types/index";
import { PORT1 } from "@/api/config/servicePort";
import http from "@/api/services";

const apiUrl = {
  UPLOAD: PORT1 + "/file/upload"
};

/**
 * @name 图片上传
 */
export const uploadImg = (params: FormData) => {
  return http.post<Upload.ResFileUrl>(apiUrl.UPLOAD, params, { cancel: false });
};

/**
 * @name 视频上传
 */
export const uploadVideo = (params: FormData) => {
  return http.post<Upload.ResFileUrl>(apiUrl.UPLOAD, params, { cancel: false });
};

/**
 * @name 文件上传
 */
export const uploadFile = (params: FormData) => {
  return http.post<Upload.ResFileUrl>(apiUrl.UPLOAD, params, { cancel: false });
};
